extends Panel

@onready var background:Sprite2D=$Background
@onready var item:Sprite2D=$CenterContainer/Panel/Item
@onready var number:Label=$CenterContainer/Panel/Label

func update(cell:BagCell):
	if !cell.item:
		background.frame=0
		item.visible=false
		number.visible=false
	else:
		background.frame=1
		item.visible=true
		
		item.texture=cell.item.texture
		if cell.num>1:
			number.visible=true
			number.text=str(cell.num)

